<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
    <title>充值奖励</title>
    <jsp:include page="../../../include/header.jsp"></jsp:include>
     <style type="text/css">
			table td{
			text-align: center;
			}
		 	table th{
				text-align: center;
		 	}
		 	.col-sm-6 {
			    width: 25%;
			}
			 
			.control-labels{
				margin-left:50px;
				padding-top: 7px;
				float: left;
			}

			.red{
				color: red;
			}
			.green{
				color: lightblue;
			}
			.pcc{
				width: 110px;
				height: 34px;
			}
			.col-sm-6 {
			    width: 500px;
			}
		</style>
</head>

<body>
 
<div id="wrapper">
	
		<div>			
			<h1 class="page-header">充值奖励</h1>
		</div>
	<form id="addForm" action="${BASE_PATH}/sys/config/doEditAward" method="post" class="form-horizontal" >
	
		<div class="form-group">
		    <label class="col-sm-6 control-label">充值奖励比例：</label>
		    <div class="col-sm-2">
	        	<input value="${award.value}" type="text" name="aphone" id="aphone" class="form-control"  required autocomplete="off"  >
		    </div>
		</div>
		<div class="form-group">
		    <label class="col-sm-6 control-label">开关：</label>
		    <div class="col-sm-6">
			    <input name="radio"  type="radio" value="2" <c:if test="${award.state==2}">checked</c:if> > 开启 &nbsp;&nbsp;&nbsp;&nbsp;
			    <input name="radio"  type="radio" value="1" <c:if test="${award.state!=2}">checked</c:if> > 关闭
		    </div>
		</div>
		
		<div class="row">
			<div class="col-lg-5"><button class="btn btn-primary col-sm-3 pull-right" type="submit" autocomplete="off" >提交</button></div>
		</div>
	</form>		
	</div>		 
	
<jsp:include page="../../../include/javascripts.jsp"></jsp:include>
<script src="${BASE_PATH}/static/js/PCASClass.js" type="text/javascript"></script>
<script type="text/javascript">

$(function(){
	//初始化表单验证
	$("#addForm").validate({
		rules:{			
			aphone: {min:0}
		},
		messages:{				
			aphone:{required: "请输入奖励比例(每充值1元奖励的积分数)"}, 
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					    case 1:
							Kit.alert("奖励保存失败，请重新输入");return;
						case 0:
							Kit.alert("提交成功");return;
					}
				}
			});
		}
	});
});
</script> 
</body>	  		
</html>